import { request } from '@/utils/request.js'

/**
 * 转运单 API JS
 */

export default {
  /**
   * 获取列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'sea/waybill/index',
      method: 'get',
      params
    })
  },


  /**
   * 添加
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'sea/waybill/save',
      method: 'post',
      data
    })
  },
   /**
   * 读取转运单
   * @returns
   */
   read (id) {
    return request({
      url: 'sea/waybill/read/' + id,
      method: 'get',
    })
  },
  /**
   * 更新运单数据
   * @returns
   */
  update (data = {}) {
    return request({
      url: 'sea/waybill/update/' + data.id,
      method: 'put',
      data
    })
  },
  /**
   * 删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'sea/waybill/delete',
      method: 'delete',
      data
    })
  },
     //下载拆柜单
     CabinetRemovalList(data = {}) {
      return request({
          url: '/sea/waybill/CabinetRemovalList',
          method: 'post',
          responseType: 'blob',
          data
      })
  },
      //下载模版
      downloadTemplate(params = {}) {
        return request({
            url: '/document/shipment/downloadTemplate',
            method: 'get',
            params
        })
    },
    //通过
    pass(data = {}) {
      return request({
          url: '/sea/waybill/pass',
          method: 'post',
          data
      })
  },
   //拒绝
   reject(data = {}) {
    return request({
        url: '/sea/waybill/reject',
        method: 'post',
        data
    })
},
   //待结算
   pendingSettlement(data = {}) {
    return request({
        url: '/sea/waybill/pendingSettlement',
        method: 'post',
        data
    })
},
 //已结算
 settlement(data = {}) {
  return request({
      url: '/sea/waybill/settlement',
      method: 'post',
      data
  })
},
  /**
   * 添加海外仓地址
   * @returns
   */
  saveSeaAddress (data = {}) {
    return request({
      url: 'logistics/addressLibDetail/saveSeaAddress',
      method: 'post',
      data
    })
  },
    //准备提柜
    prepareCarry(data = {}) {
    return request({
        url: '/sea/waybill/prepareCarry',
        method: 'post',
        data
    })
  },
    //已提柜
    carry(data = {}) {
    return request({
        url: '/sea/waybill/carry',
        method: 'post',
        data
    })
  },
}